 <{extends file="<{$tempdir}>/public/admin.html"}> 
   <{block name=extendjs}>
<script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/artdialog/plugins/iframeTools.js"></script>
 <{/block}>
 <{block name=controlname}><{if empty($gginfo)}>添加规格<{else}>编辑规格<{/if}><{/block}>
 <{block name=bodylist}> 
   <div style="width:98%;overflow-y:auto;white-space:nowrap;">  
      	
          <div class="tags"> 
           
          <div id="tagscontent">
            <form method="post" name="form1" action="<{ofunc type=url link="/adminpage/shop/module/savemaingg"}>"  >
              <div>
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <tbody>
                    <input type="hidden" name="id" value="<{$gginfo['id']}>">
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff">
                      <td class="left">规格名称</td>
                      <td><input type="text" name="name" id="name" value="<{$gginfo['name']}>" class="skey" style="width:150px;" ></td>
                    </tr> 
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff">
                      <td class="left">排序ID</td>
                      <td><input type="text" name="orderid" id="orderid" value="<{$gginfo['orderid']}>" class="skey" style="width:150px;" ></td>
                    </tr> 
					<{if empty($gginfo)}>
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff">
                      <td class="left">所属类型</td>
                      <td><select name="shoptype">
                      	<{foreach from=$shoptype key=mykey item=items}>
                      	<option value="<{$mykey}>" <{if $gginfo['shoptype'] == $mykey}>selected<{/if}>><{$items}></option>      
                      		<{/foreach}>                	
                      </select>
                      	</td>
                    </tr>  
					<{else}>
					 <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff">
                      <td class="left">所属类型</td>
                      <td> <{$shoptype[$gginfo['shoptype']]}>
                      	</td>
                    </tr>  
					
					<{/if}>
                  </tbody>
                </table>
              </div>
              <div class="blank20"></div> 
              <input type="hidden" name="subtype" value="1">
               <input type="submit" value="确认提交" class="button">  
            </form>
          </div>
		  <{if !empty($gginfo)}>
          <div id="tagscontent">
             <div id="con_one_1">

              <div class="table_td" style="margin-top:10px;">

              <form method="post" action="" onsubmit="return remind();"  id="delform">

                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">

                    <thead> 
                      <tr> 
                        
                        <th align="center">ID</th> 
                        <th align="center">规格值</th>   
						  <th align="center">排序</th>   
                        <th align="center">操作</th> 
                      </tr>

                    </thead> 

                     <tbody>
                     
                      <{foreach from=$ggdet item=items}> 
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff"> 
                         
                        <td align="center"><{$items['id']}></td> 
                        <td align="center"> <{$items['name']}> </td>  
						<td align="center"> <{$items['orderid']}> </td>  
                        <td align="center"><a href="javascript:void(0);" onclick="doaddgg('<{$gginfo['id']}>','<{$items['id']}>','<{$items['orderid']}>','<{$items['name']}>');"><img src="<{$siteurl}>/templates/<{$tempdir}>/public/images/admin/edit.jpg"></a> 
                        	<a onclick="return remind(this);" href="<{ofunc type=url link="/adminpage/shop/module/delgoodschildgg/id/<{$items['id']}>/datatype/json"}>"><img src="<{$siteurl}>/templates/<{$tempdir}>/public/images/admin/del.jpg"></a></td> 
                      </tr> 
                       <{/foreach}> 
					   
					   
					   

                    </tbody> 

                  </table>

                <div class="blank20"></div> 

                </form> 
				<div class="page_newc">
                 	     <div class="select_page"> 
                 	          <a  href="javascript:void(0);"  onclick="doaddgg('<{$gginfo['id']}>',0,0,'');" class="delurl">添加规格值</a> 
                 	     	</div> 
                 </div>

                <div class="blank20"></div>

              </div>

            </div>
          </div>
		  <{/if}>
        </div>
        <div class="blank20"></div> 
      
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>


 </div> 
 <script>
 
 function doaddgg(parent_id,nowid,noworder,nowname)
{
	var ttitle = nowname == ''?'添加规格值':'编辑'+nowname+'规格值';
   var	htmls = '<form method="post" id="subyj" action="#" style="text-align:center;"><table>';
	htmls += '<tbody>';
	htmls += '<tr><td height="50px">规格值:</td>';
	htmls += '<td> <input type="text" name="name" value="'+nowname+'" style="width:100px;"></td></tr>';
	htmls += '<tr><td height="50px">排序:</td>';
	htmls += '<td> <input type="text" name="orderid" value="'+noworder+'" style="width:100px;"></td></tr>';
	htmls += '</tbody></table> ';
  htmls += '<input type="hidden" value="'+parent_id+'" name="parent_id"><input type="hidden" value="'+nowid+'" name="id"> ';
	htmls += '<input type="button" value="确认提交" class="button" id="buttonsubyj" ></form>';
  art.dialog({
    id: 'testID4',
    title:ttitle,
    content: htmls
  });
} 
$('#buttonsubyj').live('click',function(){ 
	$.post('<{ofunc type=url link="/adminpage/shop/module/savechildgg/datatype/json"}>', $('#subyj').serialize() ,function (data, textStatus){  
			if(data.error == false){
     	  	diasucces('操作成功','');
     	}else{
     		if(data.error == true)
     		{
     			diaerror(data.msg); 
     		}else{
     			diaerror(data); 
     		}
     	} 
	 }, 'json'); 
});


</script>
<{/block}>